Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove quinn-proto rustls config newtypes #511

Merged
merged 1 commit into from
Nov 23, 2019
Merged

Conversation

Ralith
Copy link
Collaborator

@Ralith Ralith commented Nov 21, 2019

These were not successful at removing rustls from our public API, and made specifying custom cryptographic configurations unintuitive. Removing them reduces the scope of our public API while preserving the friendliness of the high-level quinn API.

@Ralith Ralith added discussion enhancement New feature or request labels Nov 21, 2019
@Ralith Ralith force-pushed the unwrap-rustls-config branch 2 times, most recently from d604523 to 896e653 Compare November 21, 2019 17:51
@@ -87,6 +87,11 @@ pub trait ClientConfig<S>
where
S: Session,
{
/// Construct the default configuration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use Default for this, instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't implement Default on Arc<rustls::Client/ServerConfig>.

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a really good simplification!

}
}

/// A single TLS certificate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you move these into quinn?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the newtypes removed from quinn-proto, they're only used in the quinn builders, so they seemed out of place here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like they should live closer to the rustls implementation bits, so that they could also be swapped out along with them. Do you think that would make sense?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They also seem like things that a quinn-proto user might still find useful if they wanted to bypass the tokio stuff.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like they should live closer to the rustls implementation bits, so that they could also be swapped out along with them.

Other cryptographic protocols (e.g. noise) won't necessarily have analogous abstractions. For the specific case of other TLS implementations, we might prefer to expose a single abstract type that can be consumed by all backends, though that's pretty speculative.

They also seem like things that a quinn-proto user might still find useful if they wanted to bypass the tokio stuff.

The sole function of these types was to allow certificates/keys to be constructed without leaving the crate and passed into the helper methods that were removed, and the analogous builder methods in quinn which have been retained. While there's nonzero value in providing those helpers to hypothetical quinn-proto users, I think the resulting quinn-proto API was gratuitously weird for both quinn and quinn-proto users who need to access the rustls configuration directly, and maintaining two separate incomplete abstractions over rustls configurations wasn't a great situation.

Meanwhile, the genuine rustls API is perfectly usable. The justification for wrapping it as all is to maximize approachability for a new high-level API user, but at the quinn-proto level I think the calculus is different.

These were not successful at removing rustls from our public API, and
made specifying custom cryptographic configurations
unintuitive. Removing them reduces the scope of our public API while
preserving the friendliness of the high-level quinn API.
@Ralith Ralith force-pushed the unwrap-rustls-config branch from 896e653 to a371dd6 Compare November 21, 2019 19:14
@djc djc merged commit 9522b44 into master Nov 23, 2019
@delete-merged-branch delete-merged-branch bot deleted the unwrap-rustls-config branch November 23, 2019 19:20
djc added a commit that referenced this pull request Feb 26, 2020
This is the second time we flip-flop on this. Previously in
4fd4868 (#351) we moved these types from
quinn into quinn-proto so that they could be used as part of the low-level
configuration API.

Then in 9522b44 (#511) we moved them back
into quinn after some discussion, making the point that the configuration
API at the quinn-proto was not in a great place.

Here, we keep the existing quinn-proto configuration API and merely offer
an abstracted API relying on the wrapper types for use in quinn internals.
djc added a commit that referenced this pull request Feb 26, 2020
This is the second time we flip-flop on this. Previously in
4fd4868 (#351) we moved these types from
quinn into quinn-proto so that they could be used as part of the low-level
configuration API.

Then in 9522b44 (#511) we moved them back
into quinn after some discussion, making the point that the configuration
API at the quinn-proto was not in a great place.

Here, we keep the existing quinn-proto configuration API and merely offer
an abstracted API relying on the wrapper types for use in quinn internals.
djc added a commit that referenced this pull request Mar 6, 2020
This is the second time we flip-flop on this. Previously in
4fd4868 (#351) we moved these types from
quinn into quinn-proto so that they could be used as part of the low-level
configuration API.

Then in 9522b44 (#511) we moved them back
into quinn after some discussion, making the point that the configuration
API at the quinn-proto was not in a great place.

Here, we keep the existing quinn-proto configuration API and merely offer
an abstracted API relying on the wrapper types for use in quinn internals.
djc added a commit that referenced this pull request Mar 6, 2020
This is the second time we flip-flop on this. Previously in
4fd4868 (#351) we moved these types from
quinn into quinn-proto so that they could be used as part of the low-level
configuration API.

Then in 9522b44 (#511) we moved them back
into quinn after some discussion, making the point that the configuration
API at the quinn-proto was not in a great place.

Here, we keep the existing quinn-proto configuration API and merely offer
an abstracted API relying on the wrapper types for use in quinn internals.
Ralith pushed a commit that referenced this pull request Mar 7, 2020
This is the second time we flip-flop on this. Previously in
4fd4868 (#351) we moved these types from
quinn into quinn-proto so that they could be used as part of the low-level
configuration API.

Then in 9522b44 (#511) we moved them back
into quinn after some discussion, making the point that the configuration
API at the quinn-proto was not in a great place.

Here, we keep the existing quinn-proto configuration API and merely offer
an abstracted API relying on the wrapper types for use in quinn internals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants